package cn.edu.nuc.article.util;

import cn.hutool.core.io.FileUtil;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;

import javax.crypto.CipherInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;

import static cn.edu.nuc.article.util.SM4Tools.decryptFile;
import static cn.edu.nuc.article.util.SM4Tools.encryptFile;

public class testEnc {
    public static void main(String[] args) throws Exception {

        String sp = "D:\\bjsasc\\test\\test.txt";//原始文件
        String dp = "D:\\bjsasc\\test\\enctest.txt";//加密后文件
        String dp2 = "D:\\bjsasc\\test\\dectest.txt";//解密后文件

        String key = "05d986b1141227cb20d46d0b5687c4f5";
        byte[] keyData = ByteUtils.fromHexString(key);
        //加密文件
        FileInputStream in = new FileInputStream(sp);
        //CipherInputStream cipherInputStream = null;

        InputStream encin;
        //encin = encryptFile(in);
        //FileUtil.writeFromStream(encin, dp);
        InputStream decin = new FileInputStream(dp);
        //decryptFile(decin);
   //     FileUtil.writeFromStream(decin, dp2);
        //解密文件
      //  decryptFile(keyData,dp,dp2);
    }
}

